﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Globalization;

namespace WebsiteAdmin.Wilson.ProInfo
{
    public partial class CatEdit : System.Web.UI.Page
    {
        public int pkid;
        public string catName;
        public string catCode;
        public string imgURL;
        public string description;
        public int sortBy;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                pkid = Convert.ToInt32(Request["pkid"], CultureInfo.InvariantCulture);
                DataTable dtCategory = Bll.Category.Single(Global.ConnWilson, pkid);
                if (dtCategory.Rows.Count == 1)
                {
                    catName = dtCategory.Rows[0]["CatName"].ToString();
                    catCode = dtCategory.Rows[0]["CatCode"].ToString();
                    imgURL = dtCategory.Rows[0]["ImgURL"].ToString();
                    description = dtCategory.Rows[0]["Description"].ToString();
                    sortBy = Convert.ToInt16(dtCategory.Rows[0]["SortBy"]);
                }
                dtCategory.Dispose();
            }
        }
    }
}
